/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Model;

import java.awt.Color;
import java.awt.Graphics;

/**
 *
 * @author Manpreet
 */
public class TrafficLight {

    private int X;
    private int Y;
    private int size;
    private Color color;

    /**
     * initializes the set values of the the Traffic Light
     */
    public void init(){
        size = 20;
        X = 50;
        Y = 50;
        color = color.BLACK;
    }

    /**
     * returns the X value
     * @return
     */
    public int getX() {
        return X;
    }

    /**
     * returns the Y value
     * @return
     */
    public int getY() {
        return Y;
    }

    /**
     * sets the location of the light with the given int Y and int X values
     * @param Y
     * @param X
     */
    public void setLoc(int Y, int X) {
        this.Y = Y;
        this.X = X;
    }
    /**
     *  returns the color of the lights
     * @return
     */
    public Color getColor() {
        return color;
    }

    /**
     *  changes the color of the light to red
     */
    public void setColorRed() {
        this.color = color.red;
    }

    /**
     *  changes the color of the light to green
     */
    public void setColorGreen() {
        this.color = color.green;
    }

    /**
     *  changes the color of the light to orange
     */
    public void setColorOrange() {
        this.color = color.orange;
    }

    /**
     *  paints the traffic light to the panel using the values X, Y, size and color
     * @param g
     */
    public void draw(Graphics g) {
        g.setColor(color);
        g.fillOval(X, Y, size, size);
    }

    /**
     * initializes the traffic light
     */
    public TrafficLight() {
        init();
    }
}
